/*
	IRQ.h

	contains function headers for IRQ related things

	Author: Aidan Goddard 14/5/13
*/

#ifndef IRQ_H_INCLUDED
#define IRQ_H_INCLUDED

// PIT
double PIT_Setup(double required_frequency);

// PIC
void PIC_Setup(int start_vector);
void PIC_mask_IRQ(unsigned char IRQ);
void PIC_unmask_IRQ(unsigned char IRQ);
void PIC_Disable(void);

#define PITSetup PIT_Setup
#define PICSetup PIC_Setup
#define PICMaskIRQ PIC_mask_IRQ
#define PICUnmaskIRQ PIC_unmask_IRQ
#define PICDisable PIC_Disable

// APIC
unsigned int CalibrateAPICTimer(void);

// system interrupts
void SetupSystemIRQs(void);

// Application processor init
uint32_t InitAPs(void);

// scheduler data area init
void SetupDataArea(void);
void SetWorkingCPUCount(uint32_t CPU_count);
void StartScheduling(void);


#endif
